<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: DrawAmount Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00087.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">DrawAmount Class Reference<div class="ingroups"><a class="el" href="a00516.html">baseModules - base module classes of MiXiM</a> &#124; <a class="el" href="a00530.html">Power consumption - Classes using/defining power consumption</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="DrawAmount" -->
<p>Defines the amount of power drawn by a device from a power source.  
 <a href="a00087.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00266_source.html">BaseBattery.h</a>&gt;</code></p>

<p><a href="a00736.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00087.html#ae388439d3e21c30f465e2563199bbec4">PowerType</a> { <b>CURRENT</b>, 
<a class="el" href="a00087.html#ae388439d3e21c30f465e2563199bbec4ad8fe7930899c36833e603cd89446d86f">ENERGY</a>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of the amount to draw.  <a href="a00087.html#ae388439d3e21c30f465e2563199bbec4">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a29f037ed6bda2e8aad742a9fb9cfec07"></a><!-- doxytag: member="DrawAmount::DrawAmount" ref="a29f037ed6bda2e8aad742a9fb9cfec07" args="(int type=CURRENT, double value=0)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00087.html#a29f037ed6bda2e8aad742a9fb9cfec07">DrawAmount</a> (int <a class="el" href="a00087.html#ad7d65a7c37b7f2b4b48de40fd4e6bc0e">type</a>=CURRENT, double <a class="el" href="a00087.html#a5e5e81c528b00da622e79a04d603d4c4">value</a>=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes with passed type and value. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8cf70f5a3603f1c6e2936cfa4acdc1b9"></a><!-- doxytag: member="DrawAmount::getType" ref="a8cf70f5a3603f1c6e2936cfa4acdc1b9" args="() const " -->
virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00087.html#a8cf70f5a3603f1c6e2936cfa4acdc1b9">getType</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the type of power drawn as PowerType. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac3d6a9f36fb6f7d3141d4d28f64cf701"></a><!-- doxytag: member="DrawAmount::getValue" ref="ac3d6a9f36fb6f7d3141d4d28f64cf701" args="() const " -->
virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00087.html#ac3d6a9f36fb6f7d3141d4d28f64cf701">getValue</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the actual amount of power drawn. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7fffdcf0b57e6b1609f16351e9d4dad0"></a><!-- doxytag: member="DrawAmount::setType" ref="a7fffdcf0b57e6b1609f16351e9d4dad0" args="(int t)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00087.html#a7fffdcf0b57e6b1609f16351e9d4dad0">setType</a> (int t)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the type of power drawn. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8e411a80838eea09c6b38bc232e902ff"></a><!-- doxytag: member="DrawAmount::setValue" ref="a8e411a80838eea09c6b38bc232e902ff" args="(double v)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00087.html#a8e411a80838eea09c6b38bc232e902ff">setValue</a> (double v)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the actual amount of power drawn. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad7d65a7c37b7f2b4b48de40fd4e6bc0e"></a><!-- doxytag: member="DrawAmount::type" ref="ad7d65a7c37b7f2b4b48de40fd4e6bc0e" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00087.html#ad7d65a7c37b7f2b4b48de40fd4e6bc0e">type</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stores the type of the amount. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5e5e81c528b00da622e79a04d603d4c4"></a><!-- doxytag: member="DrawAmount::value" ref="a5e5e81c528b00da622e79a04d603d4c4" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00087.html#a5e5e81c528b00da622e79a04d603d4c4">value</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stores the actual amount. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Defines the amount of power drawn by a device from a power source. </p>
<p>Used as generic amount parameter for BaseBatteries "draw"-method.</p>
<p>Can be either an instantaneous draw of a certain energy amount in mWs (type=ENERGY) or a draw of a certain current in mA over time (type=CURRENT).</p>
<p>Can be sub-classed for more complex power draws. </p>
</div><hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="ae388439d3e21c30f465e2563199bbec4"></a><!-- doxytag: member="DrawAmount::PowerType" ref="ae388439d3e21c30f465e2563199bbec4" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="a00087.html#ae388439d3e21c30f465e2563199bbec4">DrawAmount::PowerType</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The type of the amount to draw. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="ae388439d3e21c30f465e2563199bbec4ad8fe7930899c36833e603cd89446d86f"></a><!-- doxytag: member="ENERGY" ref="ae388439d3e21c30f465e2563199bbec4ad8fe7930899c36833e603cd89446d86f" args="" -->ENERGY</em>&nbsp;</td><td>
<p>Current in mA over time. </p>
<p>Single fixed energy draw in mWs </p>
</td></tr>
</table>
</dd>
</dl>
<div class="fragment"><pre class="fragment">                 {
    CURRENT,  
    <a class="code" href="a00087.html#ae388439d3e21c30f465e2563199bbec4ad8fe7930899c36833e603cd89446d86f" title="Current in mA over time.">ENERGY</a>    
  };
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/modules/<a class="el" href="a00266_source.html">BaseBattery.h</a></li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00087.html">DrawAmount</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:32 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
